Skip to content

completions #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

completions #131

wants to merge 34 commits into from

Conversation

crpb
Copy link
Contributor

@crpb crpb commented Apr 12, 2025

crpb added 23 commits April 12, 2025 13:32
  * fix: apt-config shell options + add missing options
  * new: satisy, autoremove, autpurge, --allow-downgrades,
    --allow-remove-essential,--allow-change-held-packages, --with-new-pkgs,
    indextargets, --snapshot/-S
  * snapshot lookup via mr/timestamp
  * edit-sources file lookup for .list & .sources
 * update bts backends from `reportbug --bts help` output
     * added -raw-extract/-R, --ctrl-tarfile, --verify/-V,
     --clear-selections, --predep-package, --assert
  * added --url/-u, --noconf, --version
  * extended --component by non-free-firmware
   * fixed: --extra-package
   * changed behaviour to allow options multiple times for
     --extra-package, --dpkg-source-opt[s]
  * added --all-source-chroots, --exclude-aliases, --shell/-s
    --option/-o, --automatic-session, --session-name/-n
  * extend shell lookup via /etc/shells
 * updated archs (source: popcon)
  * complete databases
   * console should only work with running machines
   * add guestinfo to fast opts (w/o --domain)
  * add PROGRESS2 to --info
  * add json option+arguments
  * update devicetypes arguments
  * added refreservation to delegatable permissions
  * fixed scriptname completion to only list filenames
 * add eventtype "button"
  complete _deb_packages aval
  * complete _deb_packages avail
 * complete _deb_packages avail
okdana pushed a commit to okdana/zsh that referenced this pull request May 4, 2025
_apt:

  * fix: apt-config shell options + add missing options
  * new: satisy, autoremove, autpurge, --allow-downgrades,
    --allow-remove-essential,--allow-change-held-packages, --with-new-pkgs,
    indextargets, --snapshot/-S
  * snapshot lookup via mr/timestamp
  * edit-sources file lookup for .list & .sources

_apt-file: add list-indices

_bug: update bts backends from `reportbug --bts help` output

_deb_architectures: update archs (source: popcon)

_deb_files: add opt -D (.dsc)

_debmany: complete _deb_packages aval

_debsnap: complete _deb_packages avail

_dhomepage:

  * NEW (complies to latest upstream version)
    https://salsa.debian.org/debian/debian-goodies/-/commit/1f9a8a771ba68e791ceb7c4821fbdaac78f4921b

_dpkg: add missing options

  * add -raw-extract/-R, --ctrl-tarfile, --verify/-V,
    --clear-selections, --predep-package, --assert

_dpkg-info: complete _deb_packages avail

_fortune: complete databases

_libvirt:

   * console should only work with running machines
   * add guestinfo to fast opts (w/o --domain)

_losetup: remove "--delete"

_madison: add missing options

  * add --url/-u, --noconf, --version
  * extend --component by non-free-firmware
  * add url-shorthand for table "all"

_rsync:

  * add PROGRESS2 to --info

_sbuild:

  * fix: --extra-package
  * change behaviour to allow options multiple times for
    --extra-package, --dpkg-source-opt[s]

_schroot:

  * add --all-source-chroots, --exclude-aliases, --shell/-s,
    --option/-o, --automatic-session, --session-name/-n
  * extend shell lookup via /etc/shells

_smartmontools:

  * add json option+arguments
  * update devicetypes arguments

_wanna-build: remove (last seen in squeeze)

_which-pkg-broke: complete _deb_packages avail

_x_utils: add eventtype "button"

_zfs:

  * added refreservation to delegatable permissions
  * fixed scriptname completion to only list filenames
_apt:

  * fix: apt-config shell options + add missing options
  * new: satisy, autoremove, autpurge, --allow-downgrades,
    --allow-remove-essential,--allow-change-held-packages, --with-new-pkgs,
    indextargets, --snapshot/-S
  * snapshot lookup via mr/timestamp
  * edit-sources file lookup for .list & .sources

_apt-file: add list-indices

_bug: update bts backends from `reportbug --bts help` output

_deb_architectures: update archs (source: popcon)

_deb_files: add opt -D (.dsc)

_debmany: complete _deb_packages aval

_debsnap: complete _deb_packages avail

_dhomepage:

  * NEW (complies to latest upstream version)
    https://salsa.debian.org/debian/debian-goodies/-/commit/1f9a8a771ba68e791ceb7c4821fbdaac78f4921b

_dpkg: add missing options

  * add -raw-extract/-R, --ctrl-tarfile, --verify/-V,
    --clear-selections, --predep-package, --assert

_dpkg-info: complete _deb_packages avail

_fortune: complete databases

_libvirt:

   * console should only work with running machines
   * add guestinfo to fast opts (w/o --domain)

_losetup: remove "--delete"

_madison: add missing options

  * add --url/-u, --noconf, --version
  * extend --component by non-free-firmware
  * add url-shorthand for table "all"

_rsync:

  * add PROGRESS2 to --info

_sbuild:

  * fix: --extra-package
  * change behaviour to allow options multiple times for
    --extra-package, --dpkg-source-opt[s]

_schroot:

  * add --all-source-chroots, --exclude-aliases, --shell/-s,
    --option/-o, --automatic-session, --session-name/-n
  * extend shell lookup via /etc/shells

_smartmontools:

  * add json option+arguments
  * update devicetypes arguments

_wanna-build: remove (last seen in squeeze)

_which-pkg-broke: complete _deb_packages avail

_x_utils: add eventtype "button"

_zfs:

  * added refreservation to delegatable permissions
  * fixed scriptname completion to only list filenames
okdana added a commit to okdana/zsh that referenced this pull request May 4, 2025
general: adjust wording for consistency, conventional mood and capitalisation

_apt:

  - improve _apt_sources(). simplify apt-config calls. add fall-back paths.
    don't create global sources array

  - rename _snapshotdates() to _apt_snapshot_dates. eliminate superfluous
    getdates() function. use $commands instead of whence. eliminate superfluous
    variable

_fortune: use _files to complete databases

_smartmontools: fix -j/--json exclusivity, --json optarg style

_schroot: fix -n/-o optargs, short option optarg styles
okdana added 2 commits May 4, 2025 06:58
general: adjust wording for consistency, conventional mood and capitalisation

_apt:

  - improve _apt_sources(). simplify apt-config calls. add fall-back paths.
    don't create global sources array

  - rename _snapshotdates() to _apt_snapshot_dates. eliminate superfluous
    getdates() function. use $commands instead of whence. eliminate superfluous
    variable. show date format

_fortune: use _files to complete databases

_smartmontools: fix -j/--json exclusivity, --json optarg style

_schroot: fix -n/-o optargs, short option optarg styles
the previous implementation fetched all of the individual snapshot date+times
but then stripped off the times, leaving only the last 6 months' worth of dates.
if that's all we're going to complete, we can simply generate the dates locally

ofc this function could be significantly more elaborate, conditionally fetch
based on $PREFIX$SUFFIX, etc
@okdana
Copy link
Contributor

okdana commented May 4, 2025

(sorry if those references caused spam)

i found a few issues/inconsistencies. most are trivial but the _apt ones are more problematic

my suggested fixes: https://github.com/crpb/zsh/compare/cb/completions..okdana:zsh:dana/cb-completions

the entire change set (since that doesn't show the actual commits i guess): crpb/zsh@cb/completions...okdana:zsh:dana/cb-completions

lmk if you object to anything there, otherwise i'll merge those along with your changes

given the size of the pr and the fact that we're getting close to release i might wait until after 5.10 unless someone feels otherwise

@crpb
Copy link
Contributor Author

crpb commented May 4, 2025

hey @okdana ,

on the use of eval i have to laugh as i used that first and then @ft said i should not do it :p.
anyhow, thanks for taking the time and improving it as i'm more guessing what i do their than anything else but wanted most of those changes finally be not only in my $fpath :p.

given the size of the pr and the fact that we're getting close to release i might wait until after 5.10 unless someone feels otherwise

it would benefit the soon to be debian stable zsh release :-).
@mika 👋🏼

@okdana
Copy link
Contributor

okdana commented May 4, 2025

on the use of eval i have to laugh as i used that first and then @\ft said i should not do it :p

sorry, it did occur to me that it might've been a deliberate choice. if there were objections to it i can put it back

it would benefit the soon to be debian stable zsh release :-). @\mika 👋🏼

isn't it too late for 5.10 to go into trixie?

make optional, remove unnecessary exclusions
@crpb
Copy link
Contributor Author

crpb commented May 4, 2025

sorry, it did occur to me that it might've been a deliberate choice. if there were objections to it i can put it back

leave it, there are more of them in the completion :P.

isn't it too late for 5.10 to go into trixie?

no idea, but he should be able to say as the packager

@mika
Copy link

mika commented May 4, 2025

on the use of eval i have to laugh as i used that first and then @\ft said i should not do it :p

sorry, it did occur to me that it might've been a deliberate choice. if there were objections to it i can put it back

it would benefit the soon to be debian stable zsh release :-). @\mika 👋🏼

isn't it too late for 5.10 to go into trixie?

We're currently in the soft freeze stage (see https://release.debian.org/testing/freeze_policy.html#soft) and 11 days before hard-freeze (2025-05-15). I don't know how large and instrusive the changes between 5.9 and 5.10 will actually be, but given that last stable release v5.9 dates back 2022-05-14 (AKA ~3 years), AFAICS that will be quite something ™️ overall. I'd assume zsh 5.10 also wouldn't show up within the very next few days, nor? 🤔

So from my current PoV we probably won't see zsh 5.10 with trixie. :-/

@okdana
Copy link
Contributor

okdana commented May 4, 2025

it's in the testing phase, so it's possible it gets released before hard freeze. but yeah it will have some major changes so even if policy allowed it i'd hesitate to suggest putting it in this late

@mika
Copy link

mika commented May 4, 2025

it's in the testing phase,

Good to hear, looking forward!

so it's possible it gets released before hard freeze. but yeah it will have some major changes so even if policy allowed it i'd hesitate to suggest putting it in this late

ACK, thanks!

@crpb
Copy link
Contributor Author

crpb commented May 16, 2025

@okdana
today i realized that the completion with e.g. apt-get source isn't implemented at all for only source packages. i tinkered a bit with it but would kindly ask if you could add that aswell because the logic of retrieving those was alreadty added 9 years ago but never used in _apt as it seems.
What i'm talking about is compdef '_deb_packages source' moo.
So the commands like apt[-get] (source|build-dep) apt-se<TAB> should complete apt-setup which is a source-package from the installer and not usable in any other way(like install/..) afaik.

I got the completion working with _apt-cmd but in that _apt-get i'm again struggling so i thought this would be easier this way 🙈 🙊 🙉

okdana added 4 commits May 16, 2025 11:03
general: adjust wording for consistency, conventional mood and capitalisation

_apt:

  - improve _apt_sources(). simplify apt-config calls. add fall-back paths.
    don't create global sources array

  - rename _snapshotdates() to _apt_snapshot_dates. eliminate superfluous
    getdates() function. use $commands instead of whence. eliminate superfluous
    variable. show date format

_fortune: use _files to complete databases

_smartmontools: fix -j/--json exclusivity, --json optarg style

_schroot: fix -n/-o optargs, short option optarg styles
the previous implementation fetched all of the individual snapshot date+times
but then stripped off the times, leaving only the last 6 months' worth of dates.
if that's all we're going to complete, we can simply generate the dates locally

ofc this function could be significantly more elaborate, conditionally fetch
based on $PREFIX$SUFFIX, etc
make optional, remove unnecessary exclusions
@okdana
Copy link
Contributor

okdana commented May 16, 2025

@crpb i looked at it briefly. it should be as simple as having source and build-dep make two calls to _deb_packages with _alternative. we could also account for --only-source if we wanted to be complete

idk what the clean/idiomatic way to do that with _regex_arguments is though. tbh i can't stand it and i don't want to learn. rather than just copy+paste everything i'll have to let someone more knowledgeable figure out how to structure/format it

@crpb
Copy link
Contributor Author

crpb commented May 17, 2025

idk what the clean/idiomatic way to do that with _regex_arguments is though. tbh i can't stand it and i don't want to learn. rather than just copy+paste everything i'll have to let someone more knowledgeable figure out how to structure/format it

hah! i struggle with that extremly as i want to extend the wpctl completion. not my latest local thing but you will see silly it looks :P

If you know someone please ask them.

okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
…which-pkg-broke

dhomepage wording tweaked by dana
okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
_apt-file: add list-indices (wording tweaked by dana)

_bug: update bts backends from `reportbug --bts help` output

_debsnap: complete -l as --list

_deb_architectures: update archs (source: popcon)

_losetup: remove "--delete"

_rsync: add PROGRESS2 to --info

_x_utils: add eventtype "button"
okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
okdana pushed a commit to okdana/zsh that referenced this pull request Jun 5, 2025
_apt-file: add list-indices (wording tweaked by dana)

_bug: update bts backends from `reportbug --bts help` output

_debsnap: complete -l as --list

_deb_architectures: update archs (source: popcon)

_losetup: remove "--delete"

_rsync: add PROGRESS2 to --info

_x_utils: add eventtype "button"
@okdana
Copy link
Contributor

okdana commented Jun 5, 2025

since there's no end in sight yet for 5.10 testing and i've been merging other minor/new completion stuff, i decided to go ahead with at least the most trivial of these changes. they've been merged as abced20 (new functions), 606967d (removed functions), and 07a50d5 (minor updates)

i may or may not do any of the rest before release. just nervous about breaking existing functionality (and conscious of the fact that i can keep rationalising 'just one more' right up to the end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants